package com.study.www.demo.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ServletContextRequestLoggingFilter;

/**
 * @author zhuyanpeng
 * @since 2020/1/6
 */
@Slf4j
@Configuration
public class DemoRequestLoggingFilter {

//    @Autowired
//    private ServletContextRequestLoggingFilter contextRequestLoggingFilter;

    @Bean
    public ServletContextRequestLoggingFilter servletContextRequestLoggingFilter(){
        ServletContextRequestLoggingFilter servletContextRequestLoggingFilter = new ServletContextRequestLoggingFilter();
        servletContextRequestLoggingFilter.setIncludeClientInfo(false);
        servletContextRequestLoggingFilter.setBeforeMessagePrefix("卧室隔壁灯太闪");
        return servletContextRequestLoggingFilter;
    }

}
